package cn.edu.tsinghua.mutimedia.map.image;

import java.io.IOException;




import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import cn.edu.tsinghua.mutimedia.image.extract.Extract;
import cn.edu.tsinghua.mutimedia.util.Conf;

public class ImageFeatherExtractMap extends Mapper<Text, Text,Text, Text>{

	public void map(Text key, Text value, Context context
            ) throws IOException, InterruptedException {
	try  
	{ 
		System.out.println("ImageFeatherExtractMap***************************value:"+key.toString());
		Conf.copyToLocal(key.toString());
		Path filePath=new Path(key.toString());
	   	String[] strs={Conf.LOCAL_VIDEO_DIR+filePath.getName()};
	   	System.out.println("ImageFeatherExtractMap***************************filePath.getName():"+filePath.getName());
		Extract.extract(strs);
	 }  
	 catch (Exception e)  
	 {  
	     System.out.println("Error in processing");  
	 }  
	 context.write(key, new Text());  
	} 
}
